package com.lkm.app_ui.help;

import android.os.Handler;
import android.view.KeyEvent;

import com.lkm.market2_0.m.steelyardserver.OnSteelyardKeyEvent;



public class OnSteelyardKeyEventHelp {



    public static boolean onSendKeyFormK(int keyCode, Handler mainHandler){

        if(keyCode >= KeyEvent.KEYCODE_0 && keyCode <= KeyEvent.KEYCODE_9){
            OnSteelyardKeyEvent.sendKey(keyCode - KeyEvent.KEYCODE_0 + OnSteelyardKeyEvent.KEYCODE_0,mainHandler);
            return true;
        }
        int key = 0;
        switch (keyCode){
            case KeyEvent.KEYCODE_D:
                key = OnSteelyardKeyEvent.KEYCODE_DOT;
                break;
            case KeyEvent.KEYCODE_P:
                key = OnSteelyardKeyEvent.KEYCODE_PAY;
                break;
            case KeyEvent.KEYCODE_F:
                key = OnSteelyardKeyEvent.KEYCODE_FUN;
                break;
            case KeyEvent.KEYCODE_C:
                key = OnSteelyardKeyEvent.KEYCODE_CLEAR;
                break;

        }
        if (key != 0) {
            OnSteelyardKeyEvent.sendKey(key,mainHandler);
            return true;
        }
        return false;

    }
}
